<?php
class SqliteDriver extends Object
{
    protected $link;

    public function SqliteDriver($file)
    {
        $this->link = sqlite_open($file);
    }

    public function query($sql)
    {
        return sqlite_query($sql, $this->link, SQLITE_ASSOC);
    }

    public function close()
    {
        return sqlite_close($this->link);
    }

    public function lastInsertRowid()
    {
        return sqlite_last_insert_rowid($this->link);
    }

    public function changes()
    {
        return sqlite_changes($this->link);
    }

    public function queryExec($sql)
    {
        return sqlite_exec($sql, $this->link);
    }

    public function lastError()
    {
        return sqlite_last_error($this->link);
    }
}
?>
